package com.aaa.day02.myclass;

/**
 * @author ：Teacher陈（86521760@qq.com）
 * @date ：Created in 2024/11/12 16:08
 * @description：子类
 * @modified By：
 * @version: 1.0
 */
public class Son   extends Father{
    int age;

    public Son() {
    }

    public Son(int age) {
        this.age = age;
    }

    public Son(int id, String name, int age) {
        //首先调用父类的构造器
        super(id, name);
        System.out.println("子类的构造器被调用了");
        this.age = age;

    }

    @Override
    public void kill() {
        super.kill();
        System.out.println("傻狗");
    }

    public static void main(String[] args) {
        Son son= new Son(123,"张三",30);
    }
}
